{% load static thumbnail %}

{% for reply in thread %}
    <li class="card" news-id="{{ reply.uuid_id }}">
        <div class="card-body">
            <div class="profile-picture">
                {% thumbnail reply.user.picture "x50" as im %}
                    <img src="{{ im.url }}" class="user-image pull-left" style="border-radius: 50%;" alt="用户头像">
                {% empty %}
                    <img src="{% static 'images/user.png' %}" class="pull-left" height="50px" alt="没有头像"/>
                {% endthumbnail %}
            </div>
            <div class="post">
                {% if request.user.username == reply.user.username %}
                    <a href="{% url 'news:delete_news' reply.pk %}">
                        <i class="fa fa-times pull-right" aria-hidden="true" title="点击删除这条动态"></i>
                    </a>
                {% endif %}
                <p>
                    <strong>
                        <a href="{% url 'users:detail' reply.user.username %}">{{ reply.user.get_profile_name }}</a>
                    </strong>
                </p>
                <p>{{ reply }}</p>
            </div>
        </div>
        <div class="interaction" id="interaction">
            <a href="#" class="like" title="{% for i in news.get_likers %}{{ i }}&#10;{% endfor %}">
                {% if request.user in news.get_likers %}
                    <i class="heart fa fa-heart" aria-hidden="true"></i>
                {% else %}
                    <i class="heart fa fa-heart-o" aria-hidden="true"></i>
                {% endif %}
                <span class="like-count">{{ news.count_likers }}</span>
            </a>
            <a href="#" class="comment"><i class="fa fa-comment-o" aria-hidden="true"></i>
                <span class="comment-count">{{ news.comment_count }}</span>
            </a>
            <span class="timestamp">{{ reply.created_at|timesince }}之前</span>
        </div>
    </li>
{% endfor %}
